<#assign base=request.contextPath>
<!DOCTYPE html> 
<html>
	<head>
		<title></title>
		<meta charset="utf-8">
		<#include "common/reference.ftl" />
		<#include "common/ligerui.ftl" />
		<script type="text/javascript">
		<!--
			var ligerTable = null;
			$(function(){
				
				ligerTable = $('#table').ligerGrid({
					width:'98%',
					enabledSort:false,
					pageSizeOptions:[5,10,20,50,100,200],
					height:'auto',
					alternatingRow:true,
					url:'${base}/${route}/getList',
					delayLoad:false,
					columns:[
						{display:'字典ID',name:'dictId',id:'dictId',align:'center'},
						{display:'字典名称',name:'dictName',id:'dictName',align:'center'},
						{display:'排序',name:'sortOrder',id:'sortOrder',align:'center'},
						{
							display:'是否启用',
							name:'enabled',
							id:'enabled',
							align:'center',
							render:function(row){
								var enabled = row.enabled;
						 		if(enabled){
						 			return '是';
						 		}
						 		return '否';
							}
						}
						/*
						,
						{
							display:'操 作',
							align:'center',
							render:function(row){
								var dictId = row.dictId;
								return [ 
								'<a class="edit" href="javascript:void(0)" onclick="editItem('+dictId+')"  title="编辑">',
					                '<i class="fa fa-edit"></i>',
					            '</a>',
								'<a class="edit" href="javascript:void(0)" onclick="removeItem('+dictId+')"  title="删除">',
					                '<i class="fa fa-remove"></i>',
					            '</a>'
					            ].join('');
								
							}
						}
						*/
					]
				});
				
				function reload(){
					if(ligerTable){
						var dictId = $('#selDict').val();
						ligerTable.setParm('dictId',dictId);
						ligerTable.reload();
					}
				}
			});

		    function editItem(dictId){
	        	var url='${base}/${route}/edit/'+dictId;
	            changePage(url);
		    }
		    function removeItem(dictId){
		    	layer.confirm('确定要删除吗？该数据字典所有的字典数据也将被删除',function(){
	    			$.ajax({
	            		url:'${base}/${route}/remove/'+dictId,
	            		type:'POST',
	            		data:{},
	            		dataType:'json',
	            		success:function(rst){
	            			layer.msg(rst.message);
	            			if(rst.status=='OK' && ligerTable != null ){
	            				ligerTable.reload();
	            			}
	            		}
	            	});	
	    		});
		    }
		//-->
		</script>
	</head>
	<body class="$configs["skinName"]">
		<#include "common/breadcrumb.ftl">
		<div class="widget-box">
			<div class="widget-header">
				<h5 class="lighter">
					<i class="icon-table"></i>
					数据字典列表
				</h5>
			</div>
			<div class="widget-body">
				<div id="table"><div>
			</div>
		</div>
	</body>
</html>